import httpInstance from "@/utils/http";

export function getBannerAPI(param = {}) {
  // 这里面param = {} 意思是如果不传入参数，那么param默认为一个空对象
  // 这里面因为param默认为空对象，所以，distributionSite = '1'为将distributionSite默认设置为1
  // 如果有值的话则会解构distributionSite
  const { distributionSite = "1" } = param;
  return httpInstance({
    url: "/home/banner",
    params: {
      distributionSite,
    },
  });
}
/**
 * @description: 获取新鲜好物
 * @param {*}
 * @return {*}
 */
export const findNewAPI = () => {
  return httpInstance({
    url: "/home/new",
  });
};
//获得人气推荐
export const getHotAPI = () => {
  return httpInstance({
    url: "/home/hot",
  });
};
/**
 * @description: 获取所有商品模块
 * @param {*}
 * @return {*}
 */
export const getGoodsAPI = () => {
  return httpInstance({
    url: "/home/goods",
  });
};
